package com.nothing.thread.local;

import java.util.List;
import java.util.concurrent.*;

public class ClallableTest implements Callable {
    private Integer ins;

    public ClallableTest(Integer ins) {
        this.ins = ins;
    }

    @Override
    public Integer call() throws Exception {
        System.out.println(ins);
        return ins;
    }

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ClallableTest t1 = new ClallableTest(1);
        ClallableTest t2 = new ClallableTest(2);
        ClallableTest t3 = new ClallableTest(3);
        ExecutorService service = Executors.newFixedThreadPool(3);
        Future f1 = service.submit(t1);
        Future f2 = service.submit(t2);
        Future f3 = service.submit(t3);
        System.out.println(f1.get());
        System.out.println(f2.get());
        System.out.println(f3.get());
        Persion persion = new Persion();
        if (persion != null) {
            
        }
//        List<Runnable> list = service.shutdownNow();
    }
}
